function reduceMap(arr,fn){
  let result=  arr.reduce((accumulate,current)=>{
        accumulate.push(fn(current))
        return accumulate
    },[])//妙！提前将[]传给accumulate
    return result
}
const numbers = [1, 2, 3, 4, 5];
const double = x => x * 2;
 
const doubledNumbers = reduceMap(numbers, double);
console.log(doubledNumbers); // 输出: [2, 4, 6, 8, 10]

